`:top
`!Modified Huffman coding`! is used in `F33f`_`[fax`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Fax]`_`f machines to encode black-on-white images (`F33f`_`[bitmaps`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Bitmap]`_`f). It combines the variable-length codes of `F33f`_`[Huffman coding`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Huffman_coding]`_`f with the coding of repetitive data in `F33f`_`[run-length encoding`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Run-length_encoding]`_`f.
The basic Huffman coding provides a way to compress files with much repeating data, like a file containing text, where the alphabet letters are the repeating objects. However, a single scan line contains only two kinds of elements – white pixels and black pixels – which can be represented directly as 0 and 1. This "alphabet" of only two `F33f`_`[symbols`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Symbols]`_`f is too small to apply the `F33f`_`[Huffman coding`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Huffman_coding]`_`f directly. But if we first use run-length encoding, we can have more objects to encode. Here is an example taken from the article on `F33f`_`[run-length encoding`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Run-length_encoding]`_`f:
A hypothetical scan line, with B representing a black pixel and W representing white, might read as follows:
`B100`F9d9WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW`f`b
With a run-length encoding (RLE) data compression algorithm applied to the above hypothetical scan line, it can be rendered as follows:
`B100`F9d912W1B12W3B24W1B14W`f`b
Here we see that we have several different numbers in addition to the two items "white" and "black." These numbers provide plenty of additional items to use, so the Huffman coding can be directly applied to the sequence above to reduce the size even more.
>>Contents
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[External links`#external-links]`_`f
-─
>>See also
• `F33f`_`[Fax compression`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Fax]`_`f
>>External links
• "Modified Huffman coding from UNESCO". Archived from the original on 2002-06-28.
`c`F0af`_`[↑ Back to top`#top]`_`f`a